﻿#include "SearchDialog.h"

SearchDialog::SearchDialog(QWidget *parent) : QDialog(parent) {
    setWindowTitle(u8"仓库信息");

    mainLayout = new QVBoxLayout(this);

    mainLayout->addWidget(new QLabel(u8"种类", this));
    categoryComboBox = new QComboBox(this);
    for (char c = 'A'; c <= 'Z'; ++c) {
        categoryComboBox->addItem(QString(c));
    }
    mainLayout->addWidget(categoryComboBox);

    QHBoxLayout *buttonLayout = new QHBoxLayout();
    okButton = new QPushButton(u8"查询", this);
    cancelButton = new QPushButton("Cancel", this);
    buttonLayout->addWidget(okButton);
    buttonLayout->addWidget(cancelButton);
    mainLayout->addLayout(buttonLayout);

    connect(okButton, &QPushButton::clicked, this, &QDialog::accept);
    connect(cancelButton, &QPushButton::clicked, this, &QDialog::reject);

    setLayout(mainLayout);
}
